﻿Namespace Choreography
    Public Class LedRabbitActivity
        Inherits RabbitActivityBase

        Private _ledLocation As LedLocationEnum
        Private _ledColor As Drawing.Color

        Public Property LedLocation() As LedLocationEnum
            Get
                Return _ledLocation
            End Get
            Set(ByVal value As LedLocationEnum)
                _ledLocation = value
            End Set
        End Property

        Public Property LedColor() As Drawing.Color
            Get
                If _ledColor = Drawing.Color.Empty Then
                    _ledColor = Drawing.Color.Black
                End If
                Return _ledColor
            End Get
            Set(ByVal value As Drawing.Color)
                _ledColor = value
            End Set
        End Property

        Public Sub New()

        End Sub

        Public Sub New(ByVal actionMoment As UInt32, ByVal ledLocation As LedLocationEnum, ByVal ledColor As Drawing.Color)
            MyBase.ActionMoment = actionMoment
            Me.LedLocation = ledLocation
            Me.LedColor = ledColor
        End Sub

        Public Overrides Function GetCommandString() As String
            Return System.String.Format("{0},led,{1},{2},{3},{4}", MyBase.ActionMoment, CInt(Me.LedLocation), CInt(Me.LedColor.R), CInt(Me.LedColor.G), CInt(Me.LedColor.B))
        End Function

        Public Enum LedLocationEnum
            BottomLed = 0
            LeftLed = 1
            MiddleLed = 2
            RightLed = 3
            HighLed = 4
        End Enum
    End Class
End Namespace